package com.ddd.constants;

import lombok.Getter;

/**
 *  @author: liuqisong
 *  @Date: 2021/4/17 11:53
 *  @Description:
 */ 
@Getter
public enum HttpResponseCode {
    
    ERROR(-200,"接口报错");

    private Integer val;
    private String msg;

    HttpResponseCode(Integer val, String msg) {
        this.val = val;
        this.msg = msg;
    }

    public Integer getVal() {
        return val;
    }

    public String getMsg() {
        return msg;
    }

    public static HttpResponseCode get(Byte val) {
        for (HttpResponseCode e : HttpResponseCode.values()) {
            if (e.getVal().equals(val)) {
                return e;
            }
        }
        return null;
    }

}
